﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;

namespace Himp.Platform
{
    public class OrganDataSeederContributor : IDataSeedContributor, ITransientDependency
    {
        private readonly IRepository<Organ, Guid> _organInfoRepository;

        public OrganDataSeederContributor(IRepository<Organ, Guid> organInfoRepository)
        {
            _organInfoRepository = organInfoRepository;
        }

        public async Task SeedAsync(DataSeedContext context)
        {
            //var organQuery = await _organInfoRepository.GetQueryableAsync();
            //var organ = organQuery.FirstOrDefault(m => m.OrganCodg == "00");

            //if (organ == null)
            //{
            //    organ = new Organ("00", "默认机构", "15888888888", "admin@yunpai.com"
            //        , "1q2w3E*", "admin");
            //    await _organInfoRepository.InsertAsync(organ);
            //}
        }
    }
}
